package FactoryMethodPattern.ConcreteObject;

import FactoryMethodPattern.ObjectFramework.Factory;
import FactoryMethodPattern.ObjectFramework.Product;

import java.util.ArrayList;
import java.util.List;

/**
 * 具体处理包
 * 具体的工厂类
 */
public class IDCardFactory extends Factory {

    private List owners = new ArrayList();

    public List getOwners() {
        return owners;
    }

    @Override
    public Product createProduct(String owner) {
        return new IDCard(owner);
    }

    @Override
    public void registerProduct(Product product) {
        owners.add(((IDCard)product).getOwner());
    }
}
